
package index;

import jakarta.servlet.*;
import jakarta.servlet.http.*;
import jakarta.servlet.annotation.*;
import shopping.Dish;

import java.io.IOException;
import java.util.List;

@WebServlet("/WelcomeServlet")
public class WelcomeServlet extends HttpServlet {
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        List<Dish> dishes = JdbcUtils.getAllDishes();
        request.setAttribute("dishes", dishes);
        request.getRequestDispatcher("/welcome.jsp").forward(request, response);
    }

}
